Add version control command center - #3177
Conversation
- Query open change requests across supported remotes - Surface actionable branch rows only when local branch is behind the MR/PR base - Pass remote repository context to GitHub, GitLab, and Azure DevOps CLIs
…ol-panel-work # Conflicts: # apps/web/src/components/ChatView.tsx # apps/web/src/environmentApi.ts # apps/web/src/environments/runtime/service.threadSubscriptions.test.ts # packages/client-runtime/src/wsRpcClient.ts
- Extract shared source control panel state and API wiring - Move VS Code project scope and subagent parent resolution into runtime helpers - Add tests for presentation state and subagent control resolution
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
- Treat same-name remotes as publish/pull upstreams - Split sync-state logic into shared web module - Cover publish target behavior with tests and docs
- Add `forceRefresh` support to query runners and runtime execution - Refresh cached SWR atoms before resolving so panel data stays current - Cover first-run and cached-refresh behavior with runtime tests
- Move sync refresh feedback into a compact spinner icon - Keep the banner for non-refresh sync messages
- Sum merged working-tree row stats across both sides - Keep default compare ref on the repository default branch - Restrict diverged merge sync to the checked-out branch - Surface tracked discard failures and rename sources - Move shared panel logic into the logic module
- Infer rename status for numstat fallback entries - Align diverged merge sync guard and disabled state - Clarify aggregate working-tree stats and date buckets
…ol-panel-work # Conflicts: # apps/desktop/src/electron/ElectronMenu.ts # apps/server/src/sourceControl/AzureDevOpsCli.ts # apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.test.ts # apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.ts # apps/server/src/sourceControl/GitHubCli.ts # apps/server/src/sourceControl/GitHubSourceControlProvider.test.ts # apps/server/src/sourceControl/GitHubSourceControlProvider.ts # apps/server/src/sourceControl/GitLabCli.ts # apps/server/src/sourceControl/SourceControlProvider.ts # apps/server/src/vcs/VcsStatusBroadcaster.ts # apps/server/src/ws.ts # apps/web/src/components/ChatView.tsx # apps/web/src/components/Sidebar.logic.ts # apps/web/src/hooks/useHandleNewThread.ts
There was a problem hiding this comment.
Effect Service Conventions: one finding in DesktopBackendManager.ts. See inline comment.
Posted via Macroscope — Effect Service Conventions
…rsion-control-panel-work
…rsion-control-panel-work
- Tie panel ref classifications to the wrapped action map - Skip invalidation for validation failures and cached fetches - Cover fetch-all and validation-only cache behavior
- Sequence mobile detail loads per expanded row - Keep web mutation failures separate from refresh errors - Cover both stale-error paths with focused tests
- Key environment panels by their complete cache identity - Remount in-flight refresh state when repository context changes - Cover thread, cwd, and worktree identity changes
- Release the per-cwd automatic-fetch latch after failed or interrupted attempts - Preserve successful and in-flight fetch deduplication - Cover failure retries and duplicate suppression with focused tests
There was a problem hiding this comment.
Reviewed the Effect service changes in this PR (new SourceControlPanelService and its helper modules, provider/CLI service extensions, GitVcsDriver.invalidateRefs, VcsLocalWatch, contracts/settings). The earlier FooShape aliases in GitHubCli/GitLabCli/AzureDevOpsCli/GitVcsDriver/SourceControlPanelService are gone and the panel service now declares its interface inline — thanks. Three service-convention issues remain, all in the new panel service wiring.
Posted via Macroscope — Effect Service Conventions
Construct the panel service once in the server runtime so WebSocket clients reuse snapshot and fetch caches. Use canonical optional Effect service access and keep the server route test seam explicit.
There was a problem hiding this comment.
Reviewed the Effect service changes in this PR (new SourceControlPanelService + Readers/Actions split, SourceControlProvider error factory, provider CLI/API additions, VcsLocalWatch/VcsStatusBroadcaster, contracts/client-runtime wiring).
Prior findings look addressed: the panel service now declares its interface inline in Context.Service, keeps imports at the top, acquires optional dependencies with Effect.serviceOption, exposes make/layer, is registered in server.ts, and ws.ts acquires it from the environment instead of constructing it per session. The FooShape aliases are gone and tests use Foo["Service"].
Two remaining findings, both about error wrapping: the new wrappers replace the immediate underlying failure with a flattened, stringified copy instead of preserving it as cause, and derive detail (and therefore the wrapper message) from cause.message.
Posted via Macroscope — Effect Service Conventions
Stop deriving provider and panel wrapper details from unknown cause messages. Preserve the existing bounded transport-safe cause projection so credential-bearing CLI failures cannot cross the RPC boundary.
…ol-panel-work # Conflicts: # apps/server/src/vcs/VcsStatusBroadcaster.test.ts # apps/server/src/vcs/VcsStatusBroadcaster.ts # apps/server/src/ws.ts # apps/web/src/components/ChatView.tsx # packages/contracts/src/settings.ts # packages/shared/src/serverSettings.test.ts
- Compare legacy values against the customized flat default - Cover migration of persisted thirty-second fetch settings
- Pin the upstream empty-object background activity default - Prove balanced profiles override the branch legacy flat default
- Disable color, external diff helpers, and text conversion - Cover ref-backed and no-range comparison patch paths
- Pin patch prefixes and context against Git configuration - Avoid minimal diff work on previously unbounded paths - Cover hardened arguments in focused server tests
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 10 total unresolved issues (including 9 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 03517b2. Configure here.
- Send rename source paths only for renamed rows - Cover web and mobile copy diff path selection

PR id: 3177
PR url: #3177
PR title: Add version control command center
PR target: pingdotgg/t3code:main
PR head: Quicksaver:split/version-control-panel-work
Summary
Adds a Git-backed Version Control command center to the web right panel and a native mobile route. It is scoped to each repository cwd, works from draft or existing conversations once repository context is available, and keeps Git operations server-authoritative across browser, desktop, VS Code, mobile, and remote clients.
The panel focuses on actionable repository work rather than acting as a full Git dashboard: dirty working trees, branch sync state, stashes, remotes, sibling worktrees, likely fork branches, and open change-request bases.
What Changed
SOURCE_CONTROL.mdas the behavior and validation reference for the Version Control panel..git/event filtering.ActionableandRemotessections, file selection and diffs, searchable compare bases, branch/stash/commit details, guarded destructive actions, context menus, manual fetch controls, and a conservative five-minute automatic fetch interval.expectedBranchserver guards.SourceControlPanelServiceto the server runtime so every WebSocket client shares snapshot state and automatic-fetch de-duplication, while retaining optional provider and text-generation integrations through canonical Effect service access.cause.message, while retaining the bounded transport-safe cause projection required to prevent credential-bearing CLI failures from crossing the RPC boundary.Why
T3 Code needs a compact place to answer “what repository work needs attention now?” without forcing users into a full external Git UI. This change keeps the surface decision-oriented: commit or stash selected changes, inspect branch sync state, publish or sync branches, review stashes, and notice when a PR/MR base has moved.
Keeping Git execution and reconciliation on the server gives every client the same behavior, while local watchers and bounded periodic fetching keep the panel current without a high-frequency polling loop.
Validation
SourceControlPanelService, panel parsers, Git/VCS behavior, watcher lifetimes, provider discovery and diagnostics, and Azure DevOps and self-hosted GitLab paths.HttpResponseCompression.tsResponse.bodyincompatibility; later package-wide web and mobile typechecks were likewise blocked by unrelated upstream and linked-package errors outside the changed Version Control files.13782and web5742authenticated and rendered liveActionableandRemotesdata from disposable Git repositories. They also exercised project-context switching without cross-cache state leakage, selected-file commit success and failure, post-hook reconciliation, literal-path discard/stash isolation, live mutation refresh behavior, and a destination-only copied-file diff.13782and this worktree’s Metro bundle, rendered the live Version Control panel from disposable Git repositories, exercised collapse/re-expand detail loading, exercised a conflicting branch checkout, and rendered a destination-only copied-file diff. The representative simulator streams reached live rendered frames through serve-sim.Proof
Note
High Risk
Large cross-stack Git mutation surface (server-authoritative refs, index, fetch defaults, and thread metadata) with broad behavioral and concurrency edge cases; incorrect reconciliation or stale snapshots could mislead users or leave repo state inconsistent with the UI.
Overview
Introduces a Git-backed Version Control panel on the web right panel (
source-controlsingleton) and a native Version Control full-screen route on mobile, both driven by a shared serverSourceControlPanelServiceand a large set of newvcs.panel.*WebSocket RPCs (snapshots, working-tree commit/stash/discard, branches, stashes, remotes, diffs, compare).The web surface federates one panel per connected environment in a logical repo group (active first), keeps Git work cwd- and environment-scoped, and routes thread branch metadata updates with
expectedBranchguards and per-thread error state. Mobile adds Actionable / Remotes UI, selected-file flows, publish-remote prompting, sequenced snapshot/detail requests, and a Version Control diff overlay using the native Review renderer.Freshness and caching: VCS watchers ignore internal
.git/noise, retain sibling worktrees, and promote working-tree refreshes to full snapshots when branch/remote state may be stale; ref-changing mutations invalidate shared ref caches on settle (server + client). Default automatic remote fetch moves to a 5-minute custom profile (explicit presets still use 15s / 30s / disabled).Smaller glue: Git menus link to Version Control; Electron context menus honor explicit separators and destructive grouping; mobile git checkout sheets only pop on success; atom query runners support
forceRefreshfor panel reads.Reviewed by Cursor Bugbot for commit b054cde. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Version Control panel with branch, working tree, and diff management to web and mobile
getCommitAvatarUrland remote-context-aware PR listing; adds a per-providershowCommitAuthorAvatarsetting defaulting tofalseforceRefreshsupport toexecuteAtomQueryanduseAtomQueryRunneron both web and mobile so VCS panel queries bypass SWR cache after mutationsautomaticGitFetchIntervalfrom 30 seconds to 5 minutes in settings.tsMacroscope summarized b054cde.